package com.lc.afbx.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/5/28.
 */
@HttpInlet(Conn.INLET_TUI_JIAN_YOU_JING_XI)
public class GetApiYouJingXi extends BaseNOSecret<GetApiYouJingXi.Info> {

    public GetApiYouJingXi(AsyCallBack<Info> asyCallBack) {
        super(asyCallBack);
    }

    protected Info parser(JSONObject jsonObject) {

        TOAST = jsonObject.optString("message");

        if (jsonObject.optInt("code") == 200) {

            Info info = new Info();
            JSONObject o = jsonObject.optJSONObject("data");

            Data d = new Data();
            d.picurl = Conn.PIC + o.optString("picurl");
            d.web = o.optString("web");

            info.data = d;

            return info;
        }
        return null;
    }

    @Override
    protected boolean skipSecret(String key) {
        return super.skipSecret(key);
    }

    public static class Info {

        public Data data;
    }

    public static class Data {

        public String picurl, web;
    }
}
